using IQIGame.Onigao.GamePlay;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 改变环境里的时间显示
    /// </summary>
    public class ExecUpdateTimeEnvShow : BaseServiceExecution
    {
        public override void Execute(LevelRegion region, LevelPlayer player)
        {
            var config = _config as ExecParamUpdateTimeEnvShow;

            int timeHour = config.timeHour;

            if (timeHour < -1)
            {
                PrintParamInvalidError();
                return;
            }

            region.level.ChangeTime(timeHour);
            region.NotifyLevelTimeShowChange(player, timeHour);
        }
    }
}
